package com.baizhi.controller;

import com.baizhi.entity.Menu;
import com.baizhi.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller


public class MenuController {

    @Autowired
    private MenuService menuService;


    @RequestMapping("/menu/select")
    @ResponseBody
    public Map select(){
        Map map =new HashMap();
        System.out.println("进入菜单栏查询");
        List<Menu> menus = menuService.selectAll();
        map.put("menus",menus);
        return map;
    }
}
